home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 1 / Gold Medal Software Volume 1 (Gold Medal) (1994).iso / prog / tpwprog5.arj / RECT.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-07-02  |  1.0 KB  |  52 lines

  1. { rect.pas -- Draw a rectangle in a window }
  2.  
  3. program Rect;
  4.  
  5. uses WinTypes, WinProcs, WObjects;
  6.  
  7. type
  8.  
  9.   RectApplication = object(TApplication)
  10.     procedure InitMainWindow; virtual;
  11.   end;
  12.  
  13.   PRectWindow = ^RectWindow;
  14.   RectWindow = object(TWindow)
  15.     procedure Paint(PaintDC: HDC; var PaintInfo: TPaintStruct);
  16.       virtual;
  17.   end;
  18.  
  19. { RectApplication }
  20.  
  21. {- Initialize the application's window }
  22. procedure RectApplication.InitMainWindow;
  23. begin
  24.   MainWindow := New(PRectWindow, Init(nil, 'Rectangle'))
  25. end;
  26.  
  27. { RectWindow }
  28.  
  29. {- Paint graphics in window }
  30. procedure RectWindow.Paint(PaintDC: HDC; var PaintInfo:
  31.   TPaintStruct);
  32. begin
  33.   Rectangle(PaintDC, 10, 10, 100, 100)
  34. end;
  35.  
  36. var
  37.  
  38.   RectApp: RectApplication;
  39.  
  40. begin
  41.   RectApp.Init('RectApp');
  42.   RectApp.Run;
  43.   RectApp.Done
  44. end.
  45.  
  46.  
  47. {--------------------------------------------------------------
  48.   Copyright (c) 1991 by Tom Swan. All rights reserved.
  49.   Revision 1.00    Date: 2/20/1990
  50. ---------------------------------------------------------------}
  51.  
  52.